class Dog:
    """一次模拟小狗的简单尝试。"""
    def __init__(self,name,age):
        """初始化属性name和age"""
        self.name=name
        self.age=age

    def sit(self):
        """模拟小狗收到命令时蹲下"""
        print(f"{self.name} is now sitting.")

    def roll_over(self):
        """模拟小狗收到命令时打滚"""
        print(f"{self.name} rolled over !")

#表示特定小狗的实例
my_dog=Dog('Wille',6)

print(f"My dog's name is {my_dog.name}.")
print(f"My dog is {my_dog.age} years old.")

my_dog.sit()
my_dog.roll_over()

#再创建一个小狗实例
your_dog=Dog("Lucy",3)

print(f"\nYour dog's nmae is {your_dog.name} .")
print(f"Your dog is {your_dog.age} years old .")
your_dog.sit()
